import request from '@/utils/request.js'
import imagetoken from './image.js'

// 获取评论管理的数据
export const reqArticleComment = params => {
  return request({
    method: 'GET',
    headers: {
      Authorization: imagetoken.token
    },
    url: imagetoken.baseurl + 'mp/v1_0/articles',
    params
  })
}

// 开启/关闭文章评论区
export const reqCommentStatus = (articleId,allowComment) => {
  return request({
    method: 'PUT',
    headers: {
      Authorization: imagetoken.token
    },
    url: imagetoken.baseurl + 'mp/v1_0/comments/status',
    params: {
      article_id: articleId
    },
    data: {
      allow_comment: allowComment
    }
  })
}
